package QueryExcecution;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import queryClass.Queries;

import DB.DAOManager;
public class NewPollQuestion {
	Queries q=new Queries();
	PreparedStatement pstmt=null;
	public int addNewPoll(String Question) throws ClassNotFoundException, SQLException{
		DAOManager dao;
		int rows=0;
		String addPollQueryString= q.addPollQuery;
		dao = new DAOManager();
		Connection conn=dao.getConnection();
		System.out.println("New poll being added !!!!");
		pstmt=conn.prepareStatement(addPollQueryString);	

		pstmt.setString(1, Question);
		pstmt.setInt(2, 0);
		pstmt.setInt(3, 0);
		pstmt.setInt(4, 0);
		System.out.println("All strings and int set !!!");
		rows = pstmt.executeUpdate();

		return rows;
	}
}
